import React, { Component } from 'react'
import { Route, Switch,Redirect } from 'react-router-dom';
import MyNavLink from '../../components/MyNavLink';
import News from './news';
import Message from './message';
export default class Home extends Component {
  render() {
    return (
      <div>
        home
        <ul className="nav nav-pills mb-3">
          <li className="nav-item">
            <MyNavLink to="/home/news">news</MyNavLink>
          </li>
          <li className="nav-item">
            <MyNavLink to="/home/message">message</MyNavLink>
          </li>
        </ul>
        <div className="tab-content">
          <Switch>
            <Route path="/home/news" component={News}></Route>
            <Route path="/home/message" component={Message}></Route>
            <Redirect to="/home/news" />
          </Switch>
        </div>
      </div>
    )
  }
}
